<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ page import="com.yls.except.util.StringIsempty" %>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    String url = request.getHeader("Referer");
    if (!StringIsempty.isallempty(url))
        url = url.replace(basePath.replace(path + "/", ""), "");
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <title>新增地址</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link href="css/AddNewAddress_Css.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/public.js"></script>
    <script type="text/javascript" src="js/user/add_new_address.js"></script>
    <script>
        function back() {
            window.history.back(-1);
        }
    </script>
</head>
<body>
<form id="address_add_frm" method="post">
    <jsp:include page="/public.jsp"/>
    <input type="hidden" value="<%=StringIsempty.isallempty(request.getParameter("upurl")) ? url : request.getParameter("upurl")%>" id="upurl" name="upurl"/>
    <input type="hidden" value="<%=StringIsempty.isallempty(request.getParameter("upurl")) ? "" : request.getParameter("upurl")%>" id="hideupurl" name="hideupurl"/>
    <input type="hidden" value="<%=session.getAttribute("shopinfo") %>" id="shopinfo" name="shopinfo"/>
    <input type="hidden" value="<%=request.getParameter("addressid")%>" id="addressid" name="addressid"/>
    <input type="hidden" value="<%=request.getParameter("hidepid")%>" id="hide_pid" name="hidepid"/>
    <input type="hidden" value="<%=request.getParameter("hidecid")%>" id="hide_cid" name="hidecid"/>
    <input type="hidden" value="<%=request.getParameter("hidedid")%>" id="hide_did" name="hidedid"/>
    <input type="hidden" value="0" id="hidetype" name="hidetype"/>

<!-- 固定的title 样式 -->
<%--<header class="header">--%>
    <%--<div align="left" class="a">--%>
        <%--<img src="img/arrow_eft_circle.png" style="padding: 10px;height: 28px; width: 28px;" onclick="back()"/>--%>
    <%--</div>--%>
    <%--<div align="center" class="a">--%>
        <%--<span style="padding: 15px;font-size: 23px;color: white;">新增地址</span>--%>
    <%--</div>--%>

    <%--<div align="right" class="a">--%>
        <%--<img src="img/more.png" style="padding: 10px;height: 28px;width: 28px;"/>--%>
    <%--</div>--%>
<%--</header>--%>

<div class="other_item_nackname">
    <span>收件人</span>
    <input placeholder="请输入姓名" id="address_name"
           value="<%=StringIsempty.isallempty(request.getParameter("name")) ? "" : request.getParameter("name")%>" name="name"/>
</div>
<hr style="height: 1px; width: 97%; float: right; background-color: #f4f4f4; border: none;"/>

<div class="other_item_nackname">
    <span>电话号码</span>
    <input placeholder="请输入电话号码" id="address_phone"
           value="<%=StringIsempty.isallempty(request.getParameter("phone")) ? "" : request.getParameter("phone")%>" name="phone"/>
</div>
<hr style="height: 1px; width: 97%; float: right; background-color: #f4f4f4; border: none;"/>

<div class="other_item_nackname" onclick="chosearea();">
    <span>所在地区</span>
    <div style="float: right;">
        <img src="img/right.png" class="choose_more_pic"/>
        <span class="other_item_arae" id="area">
            <%
                String hidepname = request.getParameter("hidepname");
                String hidecname = request.getParameter("hidecname");
                String hidedname = request.getParameter("hidedname");
                if (StringIsempty.isallempty(hidepname) && StringIsempty.isallempty(hidecname) && StringIsempty.isallempty(hidedname)) {
            %>
                选择
            <%
            } else {
                String area = "";
                if (!StringIsempty.isallempty(hidepname))
                    area += hidepname + " ";
                if (!StringIsempty.isallempty(hidecname))
                    area += hidecname + " ";
                if (!StringIsempty.isallempty(hidedname))
                    area += hidedname;
                if (area.length() >= 12)
                    area = area.substring(0, 12) + "...";
            %>
            <%=area %>
            <%
                }
            %>
        </span>
    </div>
</div>
<hr style="height: 1px; width: 97%; float: right; background-color: #f4f4f4; border: none;"/>

<div class="other_item_nackname">
    <span>详细地址</span>
    <input placeholder="请输入详细地址" id="address"
           value="<%=StringIsempty.isallempty(request.getParameter("address")) ? "" : request.getParameter("address")%>" name="address"/>
</div>
<hr style="height: 1px; width: 97%; float: right; background-color: #f4f4f4; border: none;"/>

<div class="other_item_nackname">
    <span>邮政编码</span>
    <input placeholder="请输入邮政编码" id="address_postcode"
           value="<%=StringIsempty.isallempty(request.getParameter("postcode")) ? "" : request.getParameter("postcode")%>" name="postcode"/>
</div>


<div class="save" onclick="save();">
    <span>保&nbsp;&nbsp;存</span>
</div>
</form>
<jsp:include page="/files/public_hint.jsp"/>
</body>
</html>